home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batutl2.zip / INPUTTST.BAT < prev    next >
DOS Batch File  |  1988-04-16  |  1KB  |  47 lines

  1. ECHO OFF
  2. rem This demonstrates the INPUT program
  3. rem Use the ECHO statements to create a menu, then branch on the keyin
  4. rem You can chain menus by running other batch files.
  5. CLS
  6. ECHO To do the first thing type      A
  7. ECHO To do the second thing type     B
  8. ECHO To do the third thing type      3
  9. ECHO To do the fourth thing type     D
  10. ECHO To do the fifth thing type      E
  11. ECHO  
  12. rem Notice that the input can be any printable key (but forced to upper case)
  13. INPUT "AB3DE"
  14. ECHO  
  15. rem Note that the IF ERRORLEVEL checks for error or HIGHER,so you must test
  16. rem in reverse order (high first)
  17. rem ESC always returns a 255 value
  18. IF ERRORLEVEL 255 GOTO ESC
  19. IF ERRORLEVEL 5 GOTO FIVE
  20. IF ERRORLEVEL 4 GOTO FOUR
  21. IF ERRORLEVEL 3 GOTO THREE
  22. IF ERRORLEVEL 2 GOTO TWO
  23. IF ERRORLEVEL 1 GOTO ONE
  24. :ESC
  25. ECHO You pressed the ESC key
  26. GOTO STOP
  27. :ONE
  28. ECHO You pressed the A key
  29. rem User can run a program here
  30. GOTO STOP
  31. :TWO
  32. ECHO You pressed the B key
  33. rem User can run a program here
  34. GOTO STOP
  35. :THREE
  36. ECHO You pressed the 3 key
  37. rem User can run a program here
  38. GOTO STOP
  39. :FOUR
  40. ECHO You pressed the D key
  41. rem User can run a program here
  42. GOTO STOP
  43. :FIVE
  44. ECHO You pressed the E key
  45. rem User can run a program here
  46. GOTO STOP
  47. :STOP